// import Home from '@/views/home'
// import Category from '@/views/category'
// import SubCategory from '@/views/category/SubCategory'
// import Detail from '@/views/detail'
// import Mine from '@/views/mine'
// import Cart from '@/views/cart'
// import Login from '@/views/login'
// import Confirm from '@/views/confirm'
// import NavBar from '@/components/nav-bar'
// import TabBar from '@/components/tab-bar'

const Home = () => import('@/views/home')
const Category = () => import('@/views/category')
const SubCategory = () => import('@/views/category/SubCategory')
const Detail = () => import('@/views/detail')
const Mine = () => import('@/views/mine')
const Cart = () => import('@/views/cart')
const Login = () => import('@/views/login')
const Confirm = () => import('@/views/confirm')
const NavBar = () => import('@/components/nav-bar')
const TabBar = () => import('@/components/tab-bar')

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    components: {
      header: NavBar,
      default: Home,
      footer: TabBar
    },
    meta: {
      title: '首页',
      icon: '&#xea8f;',
      isTab: true
    }
  },
  {
    path: '/category',
    components: {
      header: NavBar,
      default: Category,
      footer: TabBar
    },
    children: [
      {
        path: 'sub',
        component: SubCategory,
        meta: {
          title: '子分类'
        }
      }
    ],
    meta: {
      title: '分类',
      icon: '&#xe785;',
      isTab: true
    }
  },
  {
    path: '/detail',
    components: {
      header: NavBar,
      default: Detail
    },
    meta: {
      title: '详情'
    }
  },
  {
    path: '/cart',
    components: {
      header: NavBar,
      default: Cart
    },
    meta: {
      title: '购物车',
      icon: '&#xe600;',
      isTab: true
    }
  },
  {
    path: '/mine',
    components: {
      header: NavBar,
      default: Mine,
      footer: TabBar
    },
    meta: {
      title: '我的',
      icon: '&#xe614;',
      isTab: 'true'
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      header: NavBar,
      default: Login
    },
    meta: {
      title: '登录'
    }
  },
  {
    path: '/confirm',
    components: {
      header: NavBar,
      default: Confirm
    },
    meta: {
      title: '订单详情'
    }
  }
]

export default routes
